Skip to content

Spec 006 T103a: the analysis sizes from the graph - #930

Merged
adamjohnwright merged 2 commits into
mainfrom
spec006/t103a-sizes
Nov 12, 2026
Merged

adamjohnwright merged 2 commits into
mainfrom
spec006/t103a-sizes

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Ticks T103a of specs/006-content-service-to-node/tasks.md (research D25). No endpoint yet: T103b serves /data/eventsHierarchy from this.

What it adds:

  • tools/content-node/analysis-sizes.ts computes each pathway's totalEntity and totalEntityAndInteractors from the graph, as analysis-core builds them for the AnalysisService's data file, once per species while the service runs. The rules it follows:
    • the tree from each top-level pathway through hasEvent;
    • the identifiers a pathway's reactions reach, by EntitiesBuilder's relationships;
    • the interaction partners of InteractorsBuilder's targets;
    • counting per ResourceFactory resource, sub-pathways included.
  • tools/content-node/analysis-sizes-check.ts compares it with Java's live eventsHierarchy?pathwaysOnly=true for every species with a top-level pathway. It fails on any difference outside fixtures/analysis-size-differences.json, on a recorded difference gone, on a pathway only one side has, or on a species Java does not answer.

Measured against Java, release 98, all 16 species:

Checks:

  • Unit tests over stand-in graph rows, each seen failing under a mutation of the code.
  • The check tool seen failing with a record removed, and with Java answering errors.
  • An independent review; its points are fixed in the second commit.

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits November 11, 2026 23:48
analysis-sizes.ts computes each pathway's totalEntity and
totalEntityAndInteractors as analysis-core does, from the graph, once per
species while the service runs: the tree from each top-level pathway
through hasEvent, the identifiers its reactions reach by EntitiesBuilder's
relationships, the interaction partners of InteractorsBuilder's targets,
counted per ResourceFactory resource, subpathways included.

Against Java's live eventsHierarchy for all 16 species with a hierarchy:
totalEntity matches every pathway. totalEntityAndInteractors matches but
for 84 pathways (76 human, 1 to 6 higher; 8 yeast, 1 higher), where
analysis-core merges a partner into another interactor whose alias it is
(reactome/analysis-core#13). Those are recorded with both values, and
analysis-sizes-check.ts fails on any other difference or one of them gone
(seen failing with one removed). Unit tests over stand-in rows, each seen
failing under a mutation of the code.

Research D25 corrected: the human differences reach six, not two, and
yeast has eight.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The check required no answer from Java: a species answering an error was
  skipped, its records unchecked, and a pathway only node has was never
  reported. It now takes the species from the graph's top-level pathways,
  fails on any that does not answer (seen failing with Java answering 404s),
  and compares both sides' pathways.
- Entities and targets are read for the tree's pathways whatever their own
  species, as analysis-core attaches a pathway's counts wherever it sits.
  None differs today; all 16 species still as recorded.
- The record notes that a rebuilt data file may move a Java value, since
  which interactor analysis-core's merge keeps depends on build order.
- A test for a target in a resource that does not count (seen failing with
  the skip removed); the module comment's figures corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright enabled auto-merge (squash) November 12, 2026 00:13
@adamjohnwright
adamjohnwright merged commit 62291aa into main Nov 12, 2026
8 checks passed
@adamjohnwright
adamjohnwright deleted the spec006/t103a-sizes branch November 12, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant